Skip to content

Fixed FedAvg aggregation dispatch for delta-only strategy overrides.#408

Merged
baochunli merged 1 commit intomainfrom
fedavg-fix-pr
Mar 10, 2026
Merged

Fixed FedAvg aggregation dispatch for delta-only strategy overrides.#408
baochunli merged 1 commit intomainfrom
fedavg-fix-pr

Conversation

@baochunli
Copy link
Collaborator

This PR fixed the composable FedAvg server so delta-only aggregation strategies are no longer bypassed by the inherited direct weight aggregation path. It restored the intended strategy-based execution flow for Polaris and other examples that customize delta aggregation behavior, and added regression coverage for the server dispatch rule.

Changes

  • Updated the FedAvg server dispatch logic to avoid preferring the inherited direct-weight aggregation path when a strategy customized only delta aggregation.

  • Restored the expected aggregation behavior for Polaris and other strategy-based examples whose custom logic lives in delta aggregation hooks.

  • Added a regression test that exercised server-side report processing with a delta-only aggregation strategy subclass and verified that the custom delta hook executed.

Closes #406.

The composable FedAvg server always preferred aggregate_weights() when the aggregation strategy exposed that method. This broke strategies inheriting FedAvgAggregationStrategy that override only aggregate_deltas(), because the inherited FedAvg weight aggregation path ran first and bypassed the custom delta logic entirely.

Add a dispatch guard in plato/servers/fedavg.py so the server does not take the inherited FedAvg aggregate_weights() fast path when the strategy class has customized aggregate_deltas() instead. This restores the intended execution path for Polaris and other similar strategies using the strategy-based server design.

Add a regression test covering Server._process_reports() with a delta-only FedAvg strategy subclass to ensure custom aggregate_deltas() hooks are not shadowed by inherited weight aggregation.
@netlify
Copy link

netlify bot commented Mar 10, 2026

Deploy Preview for platodocs canceled.

Name Link
🔨 Latest commit 9385b5f
🔍 Latest deploy log https://app.netlify.com/projects/platodocs/deploys/69b070d3aa5c8b00072f9c71

@baochunli baochunli merged commit 56d9a9e into main Mar 10, 2026
8 checks passed
@baochunli baochunli deleted the fedavg-fix-pr branch March 10, 2026 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] aggregate_deltas at polaris_aggregation_strategy.py

1 participant